//创建一个叫做reducer的纯函数

function reducer(state = 33, action) {
    //通过判断传递的action阿德type的类型,来决定返回什么值
    switch (action.type) {
        case 'ADD':
            return state + action.payload
        default:
            return state
    }
}

export default reducer